/*
 * Copyright (c) 2009-2013 EvTech Project
 * All rights reserved.
 * 
 * This file is part of LModeller.
 *
 * LModeller is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or 
 * (at your option) any later version.
 *
 * LModeller is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with LModeller.  If not, see <http://www.gnu.org/licenses/>.
 * 
 */
package fi.honkalampisaatio.lwjgl;

import glapp.GLApp;

import java.awt.image.BufferedImage;
import java.io.File;

import javax.imageio.ImageIO;


public class GLTexture {
	int textureHandle;
	int width;
	int height;
	
	public GLTexture(String img)
	{
		try {
			BufferedImage tempImg = ImageIO.read(new File(img));
			width = tempImg.getWidth();
			height = tempImg.getHeight();
			textureHandle = GLApp.makeTexture(img);
		} catch (Exception e) {
			System.err.println("Can't load " + img);
			width = 0;
			height = 0;
			textureHandle = 0;
		}
	}

	public int getTextureHandle() {
		return textureHandle;
	}

	public int getWidth() {
		return width;
	}

	public int getHeight() {
		return height;
	}
}
